package cn.qyd.javathread;

public class MyThreadDemo  extends Thread{
    //private volatile boolean running = true;
    private boolean running = true;

    @Override
    public void run(){
        while (running) {
            System.out.println("线程执行中");
        }
    }

    public void stopThread(){
        System.out.println("将running值改为false");
        running = false;
    }
}
